package com.chinasofti.shoot;

import java.util.Random;

//敌机 :即使飞行物 也是敌人
public class AirePlane extends FlyingObject implements Enemy{

    private int speed = 2;//走步的步数
    //构造方法
    public AirePlane(){
        image = ShootGame.airplane;
        width = image.getWidth();
        height = image.getHeight();
        Random rand = new Random();
        x = rand.nextInt(ShootGame.WIDTH - this.width);
        y = -this.height;
        //y = 200;
    }

    @Override
    public int getScore() {
        return 1000;
    }

    @Override
    public void step() {
        y += speed;//y向下走；
    }

    @Override
    public boolean outOfBounds() {
        return this.y >ShootGame.HEIGHT;
    }
}
